package zl.osimall.common.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import zl.osimall.common.bean.Addr;
import zl.osimall.common.mapper.AddrMapper;
import zl.osimall.common.service.AddrService;

import java.util.List;

@Service
public class AddrServiceImpl implements AddrService {
    @Autowired
    private AddrMapper addrMapper;
    @Override
    public List<Addr> selectByUserId(Integer userId) {
        return addrMapper.selectByUserId(userId);
    }

    @Override
    public Boolean insert(Addr addr) {
        return addrMapper.insert(addr) == 1;
    }

    @Override
    public Boolean update(Addr addr) {
        return addrMapper.update(addr) == 1;
    }

    @Override
    public Boolean delete(Integer id) {
        return addrMapper.delete(id) == 1;
    }

    @Override
    public Addr selectById(Integer id) {
        return addrMapper.selectById(id);
    }
}
